package com.codeduck.exception.exception;

import com.codeduck.exception.constant.ResponseStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 异常基类
 *
 * @author: <a href="mailto:codeduck@163.com">Codeduck</a>
 * @createDate: 2021-12-26
 */
public class BaseException extends RuntimeException{

    private String code;
    private String msg;

    public BaseException(ResponseStatus status) {
        this.code = status.getCode();
        this.msg = status.getMsg();
    }

    public BaseException(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
